package com.yupi.yuoj.judge.codesandbox;

import com.yupi.yuoj.judge.codesandbox.model.ExecuteCodeRequest;
import com.yupi.yuoj.judge.codesandbox.model.ExecuteCodeResponse;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * @author hch
 * @version 1.0
 * @description 代理模式增强代码沙箱的功能
 * @date 2024/6/25 16:08
 */
@AllArgsConstructor
@Slf4j
public class CodeSandboxProxy implements CodeSandBox {


    private final CodeSandBox codeSandBox;

    @Override
    public ExecuteCodeResponse executeCode(ExecuteCodeRequest executeCodeRequest) {
        log.info("调用信息：{}",executeCodeRequest);
        ExecuteCodeResponse executeCodeResponse = codeSandBox.executeCode(executeCodeRequest);
        log.info("执行后的信息：{}",executeCodeResponse);
        return executeCodeResponse;
    }



}
